#include <iostream>
#include <pthread.h>
#include <unistd.h>

using namespace std;

void* threadRun(void* arg)
{
    cout<<"id:"<<pthread_self()<<endl;
    int cnt = 3;
    string s = (char*)arg;
    while(cnt--)
    {
        cout<<s<<endl;
        sleep(1);
    }
    pthread_exit((void*)0);
}


int main()
{
    pthread_t td;
    int rt = pthread_create(&td,nullptr,threadRun,(void*)"123123123");
    while(true)
    {
        cout<<"i am main"<<endl;
        sleep(1);
    }

    return 0;
}
